

// 项目公告管理
var noticeColumns = [{
  id: 'title',
  title: '公告标题',
  type: 'string',
  width: 200,
  columnClass: 'text-center',
}, {
  id: 'test',
  title: '公告内容',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'name',
  title: '发布人',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'time',
  title: '发布时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.title + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var noticeOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目公告',
  datas: [{
    title: '发布标题测试数据',
    test: '发布内容测试数据',
    name: '张三测试',
    time: '2018-06-12'
  }, ],
  columns: noticeColumns,
  gridContainer: 'noticeContainer',
  toolbarContainer: 'noticeToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var noticeGrid = $.fn.dlshouwen.grid.init(noticeOption);
$(function () {
  noticeGrid.load();
});
// 会议纪要管理
var meetingColumns = [{
  id: 'mtime',
  title: '会议时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'mtitle',
  title: '会议主题',
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'name',
  title: '参会人员',
  type: 'string',
  // width: 20,
  hideType: 'xs|sm|md|lg',
  columnClass: 'text-left',
}, {
  id: 'mtest',
  title: '会议内容',
  type: 'string',
  // hideType: 'xs|sm|md|lg',
  columnClass: 'text-left',
}, {
  id: 'uname',
  title: '上传人员',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'utime',
  title: '上传时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.mtitle + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var meetingOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '会议纪要',
  datas: [{
    mtime: '2017-12-31 08:30~10:00',
    mtitle: '会议主题测试数据',
    name: '张三、李四、王五、陈六、赵七、钱八、孙九',
    mtest: '会议内容测试数据',
    uname: '张三测试',
    utime: '2018-01-01',
  }, ],
  columns: meetingColumns,
  gridContainer: 'meetingContainer',
  toolbarContainer: 'meetingToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var meetingGrid = $.fn.dlshouwen.grid.init(meetingOption);
$(function () {
  meetingGrid.load();
});
//客户管理数据
var customerColumns = [{
    id: 'customerName',
    title: '客户名称',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'customerType',
    title: '客户类型',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'industry',
    title: '行业',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'address',
    title: '地址',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'contact',
    title: '联系方式',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'personnel',
    title: '负责人',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    columnClass: 'text-center',
    width: 320,
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-success" onclick="selsu(' + record.id + ');"><i class="icon-edit"></i>  更新客户信息</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-primary" onclick="selist(' + record.id + ');"><i class="icon-eye-open"></i>  查看联系人</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-info" onclick="selsut(' + record.id + ');"><i class="icon-plus"></i>  添加联系人</button>';
      return content;
    }
  }
];
var customerOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '客户管理',
  datas: [{
    id: 1,
    customerName: '张三',
    customerType: '销售',
    industry: '城市移动网络',
    area: '华北',
    address: '北京市朝阳区XX小区2220室',
    contact: '12345678901',
    personnel: '李四'
  }, ],
  columns: customerColumns,
  gridContainer: 'customerContainer',
  toolbarContainer: 'customerToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var customerGrid = $.fn.dlshouwen.grid.init(customerOption);
$(function () {
  customerGrid.load();
});

// 编辑客户
function selsu(id){
  window.location.href = "./edit/edit-customer-1.html" + '?id=' + id;
};
// 新增联系人
function selsut(id){
  window.location.href = "./edit/edit-customer-2.html" + '?id=' + id;
};
// 查看联系人
function selist(id){
  window.location.href = "./edit/edit-customer-3.html" + '?id=' + id;
};



//联系人管理数据
var telColumns = [{
    id: 'telName',
    title: '联系人名称',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'tell',
    title: '联系方式',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'email',
    title: '邮件地址',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'annotation',
    title: '注释',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 150,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.telName + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
      return content;
    }
  }
];
var telOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '联系人管理',
  datas: [{
    id: 1,
    telName: '张三',
    tell: '12345678901',
    industry: '城市移动网络',
    email: 'zhangsan@certusnet.com',
    annotation: '测试数据'
  }, ],
  columns: telColumns,
  gridContainer: 'telContainer',
  toolbarContainer: 'telToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var telGrid = $.fn.dlshouwen.grid.init(telOption);
$(function () {
  telGrid.load();
});
// 新增联系人
function showtel() {
  $("#telbox").show();
}
// 客户拜访记录管理数据
var ctlogColumns = [{
    id: 'ltime',
    title: '拜访日期',
    width: 100,
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'lname',
    title: '客户名称',
    width: 100,
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'ltname',
    title: '拜访人',
    width: 100,
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'ltest',
    title: '具体内容',
    type: 'string',
    columnClass: 'text-left'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 150,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.lname + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
      return content;
    }
  }
];
var ctlogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '客户拜访记录',
  datas: [{
    ltime: '2018-04-01',
    lname: '张三',
    ltname: '李四',
    ltest: '具体内容测试数据',
  }, ],
  columns: ctlogColumns,
  gridContainer: 'ctlogContainer',
  toolbarContainer: 'ctlogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var ctlogGrid = $.fn.dlshouwen.grid.init(ctlogOption);
$(function () {
  ctlogGrid.load();
});
// 需求管理
var demandColumns = [{
    id: 'doName',
    title: '当前处理人',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'time',
    title: '提交时间',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'from',
    title: '来源',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'subName',
    title: '提交人',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'proLine',
    title: '产品线',
    type: 'string',
    width: 60,
    columnClass: 'text-center'
  },
  {
    id: 'priority',
    title: '优先级',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'version',
    title: '基本版本号',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'describe',
    title: '需求描述',
    type: 'string',
    columnClass: 'text-left'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 80,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-success" onclick="editdemand(' + record.id + ',' + record.demandType + ')"><i class="fa fa-edit"></i>  办理</button>';
      return content;
    }
  }
];
var demandOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '需求管理',
  datas: [{
    id: 1,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交需求申请，需求管理员审批的操作',
    demandType: 1
  }, {
    id: 2,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交需求申请，需求管理员审批结果：被退回',
    demandType: 2
  }, {
    id: 3,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交需求申请，需求管理员审批通过后的评审小组操作',
    demandType: 3
  }, 
  {
    id: 4,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员评审通过，评审小组审批结论：不通过',
    demandType: 4
  }, 
  // {
  //   id: 5,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '需求管理员评审通过，评审小组审批通过，售前产品经理审批',
  //   demandType: 5
  // },
  // {
  //   id: 6,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '需求管理员、评审小组、售前产品经理审批通过，研发领导审批',
  //   demandType: 6
  // },
  {
    id: 7,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员、评审小组、售前产品经理、研发领导审批通过，交付经理验证！',
    demandType: 7
  },{
    id: 8,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员、评审小组、售前产品经理、研发领导审批通过，交付验证未通过，再次验证',
    demandType: 8
  },{
    id: 9,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员、评审小组、售前产品经理、研发领导审批通过，交付验证通过',
    demandType: 9
  },],
  columns: demandColumns,
  gridContainer: 'demandContainer',
  toolbarContainer: 'demandToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var demandGrid = $.fn.dlshouwen.grid.init(demandOption);
$(function () {
  demandGrid.load();
});
// 处理需求
function editdemand(id, demandType) {
  if (demandType == 1) {
    window.location.href = "../../proinfo/edit/edit-demand-1.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 2) {
    window.location.href = "../../proinfo/edit/edit-demand-2.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 3) {
    window.location.href = "../../proinfo/edit/edit-demand-3.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 4) {
    window.location.href = "../../proinfo/edit/edit-demand-4.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 5) {
    window.location.href = "../../proinfo/edit/edit-demand-5.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 6) {
    window.location.href = "../../proinfo/edit/edit-demand-6.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 7) {
    window.location.href = "../../proinfo/edit/edit-demand-7.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 8) {
    window.location.href = "../../proinfo/edit/edit-demand-8.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 9) {
    window.location.href = "../../proinfo/edit/edit-demand-9.html" + '?id=' + id + '&demandType=' + demandType;
  }
}
// 问题管理
var problemColumns = [{
    id: 'doName',
    title: '当前处理人',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'time',
    title: '提交时间',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'from',
    title: '来源',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'subName',
    title: '提交人',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'proLine',
    title: '产品线',
    type: 'string',
    width: 60,
    columnClass: 'text-center'
  },
  {
    id: 'priority',
    title: '优先级',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'version',
    title: '基本版本号',
    type: 'string',
    width: 90,
    columnClass: 'text-center'
  },
  {
    id: 'describe',
    title: '问题描述',
    type: 'string',
    columnClass: 'text-left'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 80,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-success" onclick="editproblem(' + record.id + ',' + record.problemType + ')"><i class="fa fa-edit"></i>  办理</button>';
      return content;
    }
  }
];
var problemOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '问题管理',
  datas: [{
    id: 1,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交问题申请，问题管理员审批的操作',
    problemType: 1
  }, {
    id: 2,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交问题申请，问题管理员审批结果：被退回',
    problemType: 2
  }, {
    id: 3,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交问题申请，问题管理员审批通过后的评审小组操作',
    problemType: 3
  }, 
  {
    id: 4,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员评审通过，评审小组审批结论：不通过',
    problemType: 4
  }, 
  // {
  //   id: 5,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '问题管理员评审通过，评审小组审批通过，售前产品经理审批',
  //   problemType: 5
  // },
  // {
  //   id: 6,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '问题管理员、评审小组、售前产品经理审批通过，研发领导审批',
  //   problemType: 6
  // },
  {
    id: 7,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员、评审小组、售前产品经理、研发领导审批通过，交付经理验证！',
    problemType: 7
  },{
    id: 8,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员、评审小组、售前产品经理、研发领导审批通过，交付验证未通过，再次验证',
    problemType: 8
  },{
    id: 9,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员、评审小组、售前产品经理、研发领导审批通过，交付验证通过',
    problemType: 9
  }, ],
  columns: problemColumns,
  gridContainer: 'problemContainer',
  toolbarContainer: 'problemToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var problemGrid = $.fn.dlshouwen.grid.init(problemOption);
$(function () {
  problemGrid.load();
});
// 处理问题
function editproblem(id, problemType) {
  if (problemType == 1) {
    window.location.href = "../../proinfo/edit/edit-problem-1.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 2) {
    window.location.href = "../../proinfo/edit/edit-problem-2.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 3) {
    window.location.href = "../../proinfo/edit/edit-problem-3.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 4) {
    window.location.href = "../../proinfo/edit/edit-problem-4.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 5) {
    window.location.href = "../../proinfo/edit/edit-problem-5.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 6) {
    window.location.href = "../../proinfo/edit/edit-problem-6.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 7) {
    window.location.href = "../../proinfo/edit/edit-problem-7.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 8) {
    window.location.href = "../../proinfo/edit/edit-problem-8.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 9) {
    window.location.href = "../../proinfo/edit/edit-problem-9.html" + '?id=' + id + '&problemType=' + problemType;
  }
}
// 需求信息处理记录
var editDemandColumns = [{
  id: 'doTime',
  title: '操作时间',
  width: 160,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'dohistory',
  title: '操作记录',
  type: 'string',
  columnClass: 'text-left',
}, ];
var editDemandOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '需求信息处理记录',
  datas: [{
    doTime: '9999-99-99 24:00',
    dohistory: '张三提交需求申请',
  }, ],
  columns: editDemandColumns,
  gridContainer: 'editDemandContainer',
  toolbarContainer: 'editDemandToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var editDemandGrid = $.fn.dlshouwen.grid.init(editDemandOption);
$(function () {
  editDemandGrid.load();
});

// 项目文档管理
var documentColumns = [{
  id: 'filenav',
  title: '文件类目',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filetype',
  title: '文件类别',
  width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'fileName',
  title: '文件名',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filemsg',
  title: '文件说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'filelv',
  title: '文件版本',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'uname',
  title: '上传人员',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'utime',
  title: '上传时间',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 150,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="down(' + record.id + ');"><i class="icon-cloud-upload"></i>  更新</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  下载</button>';
    return content;
  }
}];
var documentOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目文档管理',
  datas: [{
    id: 1,
    filenav: '其他',
    filetype: '其他',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, ],
  columns: documentColumns,
  gridContainer: 'documentContainer',
  toolbarContainer: 'documentToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var documentGrid = $.fn.dlshouwen.grid.init(documentOption);
$(function () {
  documentGrid.load();
});

// 客户界面文档管理
var fileColumns = [{
  id: 'fileName',
  title: '文件名',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filemsg',
  title: '文件说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'filelv',
  title: '文件版本',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'uname',
  title: '上传人员',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'utime',
  title: '上传时间',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 200,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="down(' + record.id + ');"><i class="icon-cloud-upload"></i>  更新</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  下载</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var fileOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '客户界面文档管理',
  datas: [{
    id: 1,
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    uname: '张三',
    utime: '2018-08-01'
  }, ],
  columns: fileColumns,
  gridContainer: 'fileContainer',
  toolbarContainer: 'fileToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var fileGrid = $.fn.dlshouwen.grid.init(fileOption);
$(function () {
  fileGrid.load();
});

// 研发类文档管理
var dpmentColumns = [{
  id: 'filenav',
  title: '文件类目',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filetype',
  title: '文件类别',
  width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'fileName',
  title: '文件名',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filemsg',
  title: '文件说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'filelv',
  title: '文件版本',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'uname',
  title: '上传人员',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'utime',
  title: '上传时间',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 150,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="down(' + record.id + ');"><i class="icon-cloud-upload"></i>  更新</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  下载</button>';
    return content;
  }
}];
var dpmentOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '研发类文档管理',
  datas: [{
    id: 1,
    filenav: '研发体系',
    filetype: '产品Charter',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 2,
    filenav: '研发体系',
    filetype: '市场策略说明',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 3,
    filenav: '研发体系',
    filetype: 'BOM成本',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 4,
    filenav: '研发体系',
    filetype: '定价策略设计',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 5,
    filenav: '测试',
    filetype: '测试案例',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 6,
    filenav: '测试',
    filetype: '测试结果',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, ],
  columns: dpmentColumns,
  gridContainer: 'dpmentContainer',
  toolbarContainer: 'dpmentToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var dpmentGrid = $.fn.dlshouwen.grid.init(dpmentOption);
$(function () {
  dpmentGrid.load();
});

// 销售类文档管理
var salesColumns = [{
  id: 'filenav',
  title: '文件类目',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filetype',
  title: '文件类别',
  width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'fileName',
  title: '文件名',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filemsg',
  title: '文件说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'filelv',
  title: '文件版本',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'uname',
  title: '上传人员',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'utime',
  title: '上传时间',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 150,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="down(' + record.id + ');"><i class="icon-cloud-upload"></i>  更新</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  下载</button>';
    return content;
  }
}];
var salesOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '销售类文档管理',
  datas: [{
    id: 1,
    filenav: '市场体系',
    filetype: '产品技术建议书',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 2,
    filenav: '市场体系',
    filetype: '竞争对手信息和客户信息',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 3,
    filenav: '市场体系',
    filetype: '销售指导书',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 4,
    filenav: '市场体系',
    filetype: '产品白皮书',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 5,
    filenav: '市场体系',
    filetype: '高层主打胶片',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 6,
    filenav: '市场体系',
    filetype: '产品主打胶片',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 7,
    filenav: '市场体系',
    filetype: '可销售功能清单',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 8,
    filenav: '市场体系',
    filetype: '产品对外路标',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 9,
    filenav: '市场体系',
    filetype: '成功案例产品和样板点',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 10,
    filenav: '市场体系',
    filetype: '方案概述',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 11,
    filenav: '市场体系',
    filetype: '产品描述',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 12,
    filenav: '市场体系',
    filetype: '投标技术文档',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 13,
    filenav: '市场体系',
    filetype: '投标商务文档',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 14,
    filenav: '市场体系',
    filetype: '投标交付方案',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 15,
    filenav: '市场体系',
    filetype: '投标法务文档',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 16,
    filenav: '市场体系',
    filetype: '合同文本',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 17,
    filenav: '市场体系',
    filetype: '中标通知书',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, ],
  columns: salesColumns,
  gridContainer: 'salesContainer',
  toolbarContainer: 'salesToolBarContainer',
  tools: '',
  pageSize: 20,
  pageSizeLimit: [10, 15, 20]
};
var salesGrid = $.fn.dlshouwen.grid.init(salesOption);
$(function () {
  salesGrid.load();
});

// 售后类文档管理
var aftersColumns = [{
  id: 'filenav',
  title: '文件类目',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filetype',
  title: '文件类别',
  width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'fileName',
  title: '文件名',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filemsg',
  title: '文件说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'filelv',
  title: '文件版本',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'uname',
  title: '上传人员',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'utime',
  title: '上传时间',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 150,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="down(' + record.id + ');"><i class="icon-cloud-upload"></i>  更新</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  下载</button>';
    return content;
  }
}];
var aftersOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '售后类文档管理',
  datas: [{
    id: 1,
    filenav: '售后',
    filetype: '产品使用手册',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 2,
    filenav: '售后',
    filetype: '交付BOM清单',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 3,
    filenav: '售后',
    filetype: 'SLA描述',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 4,
    filenav: '售后',
    filetype: '验收报告',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, ],
  columns: aftersColumns,
  gridContainer: 'aftersContainer',
  toolbarContainer: 'aftersToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var aftersGrid = $.fn.dlshouwen.grid.init(aftersOption);
$(function () {
  aftersGrid.load();
});

// 其他类文档管理
var otherColumns = [{
  id: 'filenav',
  title: '文件类目',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filetype',
  title: '文件类别',
  width: 120,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'fileName',
  title: '文件名',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'filemsg',
  title: '文件说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'filelv',
  title: '文件版本',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'uname',
  title: '上传人员',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'utime',
  title: '上传时间',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 150,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="down(' + record.id + ');"><i class="icon-cloud-upload"></i>  更新</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  下载</button>';
    return content;
  }
}];
var otherOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '其他类文档管理',
  datas: [{
    id: 1,
    filenav: '其他',
    filetype: '证书',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, {
    id: 2,
    filenav: '其他',
    filetype: '证明材料',
    fileName: '文件名测试数据',
    filemsg: '文件说明测试数据',
    filelv: 'V 1.0',
    uname: '张三',
    utime: '2018-08-01'
  }, ],
  columns: otherColumns,
  gridContainer: 'otherContainer',
  toolbarContainer: 'otherToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var otherGrid = $.fn.dlshouwen.grid.init(otherOption);
$(function () {
  otherGrid.load();
});

//文件上传统一字段
function showfile() {
  $(".hidefile").show();
}

function hidefile() {
  $(".hidefile").hide();
}
//文件下载权限事件
function down(id) {
  //询问框
  layer.confirm('权限不足，是否申请更高权限？', {
    title: '提示信息',
    btn: ['申请', '取消'] //按钮
  }, function () {
    layer.msg('申请成功', {
      icon: 1
    });
  });
}
//时间控件
$('#time').datepicker({
  format: 'yyyy-mm-dd'
});
//时间控件
$('#time-1').datepicker({
  format: 'yyyy-mm-dd'
});
